package com.onlyphoto.onlymall.mvp.presenter

import android.content.Context
import com.onlyphoto.onlymall.base.BaseNetworkResponse
import com.onlyphoto.onlymall.base.BaseObserver

import com.onlyphoto.onlymall.mvp.contract.CQuestion
import com.onlyphoto.onlymall.mvp.model.MQuestionImpl
import com.onlyphoto.onlymall.base.BasePresenter
import com.onlyphoto.onlymall.bean.response.ArticleBean


class PQuestionImpl(mContext: Context, mView: CQuestion.IVQuestion) : BasePresenter<CQuestion.IVQuestion, MQuestionImpl>(mContext, mView, MQuestionImpl()), CQuestion.IPQuestion {
    override fun getFaqList(getType: Int, articleType: Int) {
        mModel.getFaq(getType, articleType, object :BaseObserver<ArrayList<ArticleBean>>(mContext.get()){
            override fun onSuccess(data: ArrayList<ArticleBean>?, msg: String?) {
                mView.getFaqListSuccess(data!!)
            }

            override fun onCodeError(t: BaseNetworkResponse<ArrayList<ArticleBean>>?) {
            }

            override fun onFailure(e: Throwable?) {
            }

            override fun onRequestStart() {
            }

            override fun onFinally() {
            }
        })
    }
}
